package com.se.domain.mysql;


import com.se.domain.dto.ImageFileDTO;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
public class ImgDO {
	private Long imgId;
	private String path;
	private String url;
	private Byte type;
	private Boolean active;
	private Date ctime;
	private Date utime;
	
	public ImgDO(ImageFileDTO imageFileDTO) {
		this.path = imageFileDTO.getPath();
		this.type = Type.LOCAL;
	}
	
	public static class Type{
		public static final byte LOCAL = 0;
		
		public static final byte OUTER = 1;
	}
}
/*
`img_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '图片主键',
`path` varchar(256) NULL COMMENT '图片路径',
`url` varchar(1024) NULL COMMENT '外部图片URL',
`type` TINYINT NOT NULL DEFAULT 0 COMMENT '图片类型，0：本地图片，1：外部图片',
`active` TINYINT NOT NULL DEFAULT TRUE COMMENT '是否删除',
`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
PRIMARY KEY (`img_id`)
 */
